package org.sage.sdk.dada.order.entity;

import lombok.Data;
import org.sage.sdk.dada.infrastructure.common.BaseEntity;
import org.sage.sdk.dada.infrastructure.common.attributes.ShopNo;
import org.sage.sdk.dada.infrastructure.utils.GetBodyUtil;

import javax.validation.constraints.NotNull;

/**
 * 查询追加配送员
 * <p>
 * 商户调用该接口查询可追加订单的配送员列表,接口URL地址：/api/order/appoint/list/transporter
 * <p>
 * 可追加的配送员需符合以下条件:
 * <p>
 * 1. 配送员在1小时内接过此商户的订单,且订单未完成
 * 2. 配送员在当前商户接单数小于系统限定的指定商户接单总数
 * 3. 配送员在达达平台的接单数量未达上限
 *
 * @author 周广明
 * @version v1 2019/12/10 下午7:23
 */
@Data
public class QueryAdditionalDistributor implements BaseEntity {

    @Override
    public String getUrl() {
        return "/api/order/appoint/list/transporter";
    }

    @Override
    public String getBody() {
        return GetBodyUtil.toJsonStr(this);
    }

    public QueryAdditionalDistributor(ShopNo shopNo) {
        this.shopNo = shopNo;
    }

    @NotNull
    ShopNo shopNo;
}
